package com.group9.handinhand.service.so;

import org.apache.commons.lang.ArrayUtils;

import com.group9.handinhand.dao.model.FriendshipRequest;
/**
 * Class for service of friendship request
 *
 */
public class FriendshipRequestSO extends AbstractBaseSO {
	
	private UserSO sender;
	private UserSO receiver;
	/**
	 * converts to friendship request model object
	 * @param ignoreProperties
	 * @return
	 */
	public FriendshipRequest convertToModelObject(String... ignoreProperties) {
		FriendshipRequest model = (FriendshipRequest) convert(new FriendshipRequest(),
				(String[]) ArrayUtils.addAll(ignoreProperties,new String[]{"sender","receiver"}));
		model.setSender(this.sender.convertToModelObject(new String[]{"socialUser"}));
		model.setReceiver(this.receiver.convertToModelObject(new String[]{"socialUser"}));
		return model;
	}

	public UserSO getSender() {
		return sender;
	}

	public void setSender(UserSO sender) {
		this.sender = sender;
	}

	public UserSO getReceiver() {
		return receiver;
	}

	public void setReceiver(UserSO receiver) {
		this.receiver = receiver;
	}

	@Override
	public String toString() {
		return "FriendshipRequestSO [sender=" + sender + ", receiver="
				+ receiver + "]";
	}


}
